﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" 
Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
   <%=ViewData["SiteName"] %> - <%=ViewData["PageTitle"]%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="contentpage-outerdiv">
    <%= Html.ValidationSummary() %>
    <% using (Html.BeginForm())
       { %>
    <h2>
        Role Management</h2>
    <br />
    <p>
        <b>Total Number of Roles: </b>
        <%= ViewData["TotalRoles"].ToString()%></p>
    <hr />
    <p>
        Add New Role:
        <%= Html.TextBox("newRole")%>
        &nbsp;&nbsp;
        <button type="submit" id="user-manageRole-button" >
            Add Role</button></p>
    <hr />
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="data-table">
        <tr >
            <th align="center">
                Role Name
            </th>
            <th>
                &nbsp;
            </th>
        </tr>
        <% foreach (String role in System.Web.Security.Roles.GetAllRoles())
           { %>
        <tr>
            <td>
                <%= role %>
            </td>
            <td align="center">
            <%if (role != "Admin" && role != "Editor" && role!="PortalAdmin" && role != "Contributor" && role != "User" & role != "Guest")
              { %>
            <%=Html.ActionLink("Del", "ManageRoles", "Account", new { id = role }, null)%>
            <%} %>
            </td>
        </tr>
        <% } %>
    </table>
    <% } %>
</div> 
</asp:Content>
